package day_240418;

public class Student {
    // state
    int age;

    private static Student instance;

    // constructor
    private Student() {
        System.out.println("验证构造器的调用");
    }

    // behavior
    public static Student getInstance() {
        if (instance == null) {
            instance = new Student();
        }
        return instance;
    }
}
